// 文档评论相关接口
import request from './request'
import type {
  CreateCommentRequest,
  CreateCommentResponse,
  GetCommentListResponse,
  GetSingleCommentResponse
} from '@/types/index'


// 新建评论
export const createCommentAPI = (data: CreateCommentRequest): Promise<CreateCommentResponse> => {
  return request.post('/docs/{id}/comment', data)
}

// 删除评论
export const deleteCommentAPI = (commentId: string): Promise<void> => {
  return request.delete('/docs/{id}/comment/'+{commentId})
} 

// 获取文档评论列表
export const getCommentListAPI = (docId: string): Promise<GetCommentListResponse> => {
  return request.get(`/docs/${docId}/comments`)
}

// 获取单个评论
export const getSingleCommentAPI = (CommentId: String): Promise<GetSingleCommentResponse> => {
  return request.get('/docs/comments'+{CommentId})
}